﻿using RpcModel;
using RpcModel.Tran;
using RpcModel.Tran.Model;
using RpcSync.Model;

namespace RpcSync.Collect
{
    public interface ITransactionCollect
    {
        void RollbackResult(TransactionDatum tran);
        void ApplyTransaction(MsgSource source, ApplyTran apply);
        bool TryGetTranState(Guid id,out RegTranState state);
        Guid AddTranLog(RegTranState tran, TranLogDatum datum, MsgSource source);
        Guid CheckIsRepeat(Guid tranId, TranLogDatum datum, MsgSource source);
        void CommitResult(TransactionDatum tran);
        Guid[] GetLockOverTimeTran();
        Guid[] GetOverTimeTran();
        Guid[] GetRetryTran();
        TranLog[] GetTranLogs(Guid tranId);
        TransactionDatum GetTransaction(Guid id);
        RegTranState GetTranState(Guid id);
        Guid[] LockStayCommitTran(Guid tranId);
        void Rollback(RegTranState tran);
        Guid[] RollbackTran(Guid[] tranId);
        bool SetRollbackState(TransactionDatum tran);
        void SetTranExtend(Guid tranId, string extend);
        void SubmitTran(Guid tranId);
        Guid[] TranRollbackLock(Guid tranId);
    }
}